#include "KEYL_MainView.h"
#include "Common/ViewCommon.h"
#include "ite/itu.h"

void init_SpeedMeterView(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Speed_Meter";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_SpeedMeterView(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_SpeedMeterView(ItuElement* elememt);

void init_SpeedTextView(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Speed_Text";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_SpeedTextView(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_SpeedTextView(ItuElement* elememt);

void init_RadiatorView(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Radiator_TrackBar";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_RadiatorView(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_RadiatorView(ItuElement* elememt);

void init_BatteryView(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Battery_Sprite";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_BatteryView(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_BatteryView(ItuElement* elememt);

void init_Odo1View(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Odo1_Sprite";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_Odo1View(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_Odo1View(ItuElement* elememt);

void init_Odo2View(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Odo2_Sprite";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_Odo2View(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_Odo2View(ItuElement* elememt);

void init_Odo3View(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Odo3_Sprite";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_Odo3View(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_Odo3View(ItuElement* elememt);

void init_StallView(ItuElement* elememt)
{
	const char* widgetName = "KEYW_Main_Stall_Sprite";
	LoadWidgetWithName(elememt, widgetName);
}
extern void refresh_StallView(ItuElement* elememt, bool isUnconditional);
extern void reporting_self_validity_StallView(ItuElement* elememt);


static ItuElement KEYL_Main_ItuElement_instance[] = {
	{
		init_SpeedMeterView,
		refresh_SpeedMeterView,
		reporting_self_validity_SpeedMeterView,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_SpeedTextView,
		refresh_SpeedTextView,
		reporting_self_validity_SpeedTextView,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_RadiatorView,
		refresh_RadiatorView,
		reporting_self_validity_RadiatorView,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_BatteryView,
		refresh_BatteryView,
		reporting_self_validity_BatteryView,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_Odo1View,
		refresh_Odo1View,
		reporting_self_validity_Odo1View,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_Odo2View,
		refresh_Odo2View,
		reporting_self_validity_Odo2View,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_Odo3View,
		refresh_Odo3View,
		reporting_self_validity_Odo3View,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	},
	{
		init_StallView,
		refresh_StallView,
		reporting_self_validity_StallView,
		WIDGET_NULL,
		MIN_PERIOD,
		false
	}
};

ItuElementUnited g_KEYL_Main_ItuElement = {
	KEYL_Main_ItuElement_instance,
	sizeof(KEYL_Main_ItuElement_instance)/sizeof(KEYL_Main_ItuElement_instance[0]),
};